package main

import (
	"fmt"
	"strings"
)

func main() {
	var haha = []byte{
		0x43, 0x4c, 0x54, 0x43, 0x00, 0x7b, 0x00, 0x38, 0x34, 0x39, 0x62, 0x30, 0x31, 0x36, 0x30, 0x31, 0x2e, 0x30, 0x32, 0x2e, 0x34, 0x34, 0x57, 0x45, 0x42, 0x43, 0x41, 0x4d, 0x7c, 0x32, 0x34, 0x34, 0x7c, 0x33, 0x37, 0x7c, 0x32, 0x2e, 0x30, 0x2e, 0x33, 0x37, 0x7c, 0x39, 0x7c, 0x33, 0x2e, 0x31, 0x2e, 0x30, 0x7c, 0x37, 0x35, 0x7c, 0x31, 0x2e, 0x32, 0x2e, 0x35, 0x5f, 0x6f, 0x6e, 0x64, 0x65, 0x6d, 0x61, 0x6e, 0x64, 0x7c, 0x32, 0x30, 0x32, 0x31, 0x30, 0x33, 0x32, 0x33, 0x0d, 0x0a, 0x7c, 0x42, 0x69, 0x67, 0x46, 0x61, 0x63, 0x65, 0x43, 0x61, 0x74, 0x20, 0x34, 0x2e, 0x32, 0x2e, 0x32, 0x20, 0x32, 0x30, 0x32, 0x31, 0x30, 0x33, 0x32, 0x33, 0x20, 0x50, 0x75, 0x72, 0x65, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x0d, 0x0a, 0x7c, 0x34, 0x2e, 0x32, 0x2e, 0x32, 0x0d, 0x0a, 0x7c, 0x32, 0x7c, 0x2d, 0x31, 0x7c, 0x7c, 0x32, 0x31, 0x01}
	var registStr = string(haha[14 : len(haha)-1])
	fmt.Println("registStr", registStr)
	fmt.Println("isTrue", registStr == "01.02.44WEBCAM|244|37|2.0.37|9|3.1.0|75|1.2.5_ondemand|20210323\n|BigFaceCat 4.2.2 20210323 Pure System\n|4.2.2\n|2|-1||21\n")
	fmt.Println("isTrue", registStr == registStr)
	countSplit := strings.Split(strings.TrimSpace(registStr), "|")
	fmt.Println("countSplit", countSplit)
	str := countSplit[len(countSplit)-1]
	fmt.Println("str", str)
	fmt.Println("str len", len(str))
	switch str {
	case "11", "12", "14", "15", "16", "17", "18", "19", "21":
		fmt.Println("Android 设备类型")
		break
	case "1", "3", "6", "7", "13", "20", "23", "24", "26":
		fmt.Println("单片机设备类型")
		break
	case "0", "2", "8", "9", "10":
		fmt.Println("Linux设备类型")
		break
	default:
		fmt.Println("未知的设备类型")
		// todo 断开Socket连接
		break
	}
}
